home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
params
/
frmmain.frm
< prev
next >
Wrap
Text File
|
1994-10-16
|
7KB
|
240 lines
VERSION 2.00
Begin Form frmMain
BackColor = &H00C0C0C0&
Caption = "Parameter Passing Demo Program"
ClientHeight = 3060
ClientLeft = 1395
ClientTop = 2835
ClientWidth = 7815
Height = 3465
Icon = FRMMAIN.FRX:0000
Left = 1335
LinkTopic = "Form1"
ScaleHeight = 3060
ScaleWidth = 7815
Top = 2490
Width = 7935
Begin CommandButton cmdClear
BackColor = &H00C0C0C0&
Caption = "&Clear Fields"
Height = 375
Left = 5730
TabIndex = 6
Top = 1530
Width = 1785
End
Begin CommandButton cmdExit
BackColor = &H00C0C0C0&
Caption = "E&xit Demo"
Height = 375
Left = 5730
TabIndex = 7
Top = 2430
Width = 1785
End
Begin CommandButton cmdSearch
BackColor = &H00C0C0C0&
Caption = "Search..."
Height = 300
Index = 2
Left = 6480
TabIndex = 5
Top = 1020
Width = 1005
End
Begin TextBox txtCriteria
DataSource = "dtaItems"
Height = 300
Index = 2
Left = 1500
TabIndex = 4
Top = 1020
Width = 4815
End
Begin CommandButton cmdSearch
BackColor = &H00C0C0C0&
Caption = "Search..."
Height = 300
Index = 1
Left = 6480
TabIndex = 3
Top = 600
Width = 1005
End
Begin TextBox txtCriteria
DataSource = "dtaItems"
Height = 300
Index = 1
Left = 1500
TabIndex = 2
Top = 600
Width = 4815
End
Begin CommandButton cmdSearch
BackColor = &H00C0C0C0&
Caption = "Search..."
Height = 300
Index = 0
Left = 6480
TabIndex = 1
Top = 180
Width = 1005
End
Begin TextBox txtCriteria
DataSource = "dtaItems"
Height = 300
Index = 0
Left = 1500
TabIndex = 0
Top = 180
Width = 4815
End
Begin Shape shpOutline
Height = 1305
Left = 300
Top = 1530
Width = 5145
End
Begin Shape shpShadow
BackColor = &H00808080&
BackStyle = 1 'Opaque
BorderColor = &H00808080&
Height = 300
Index = 2
Left = 1560
Top = 645
Width = 4815
End
Begin Shape shpShadow
BackColor = &H00808080&
BackStyle = 1 'Opaque
BorderColor = &H00808080&
Height = 300
Index = 1
Left = 1560
Top = 230
Width = 4815
End
Begin Shape shpShadow
BackColor = &H00808080&
BackStyle = 1 'Opaque
BorderColor = &H00808080&
Height = 300
Index = 0
Left = 1560
Top = 1060
Width = 4815
End
Begin Label lblInfo
BackColor = &H00C0C0C0&
FontBold = 0 'False
FontItalic = 0 'False
FontName = "Arial"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000080&
Height = 1185
Left = 420
TabIndex = 11
Top = 1620
Width = 5025
End
Begin Label lblTags
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Title:"
Height = 195
Index = 2
Left = 930
TabIndex = 10
Top = 1080
Width = 450
End
Begin Label lblTags
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Author:"
Height = 195
Index = 1
Left = 750
TabIndex = 9
Top = 660
Width = 630
End
Begin Label lblTags
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Publisher:"
Height = 195
Index = 0
Left = 540
TabIndex = 8
Top = 240
Width = 855
End
Begin Shape shpShadow
BackColor = &H00808080&
BackStyle = 1 'Opaque
BorderColor = &H00808080&
Height = 1200
Index = 3
Left = 450
Top = 1680
Width = 5055
End
End
Option Explicit
Sub cmdClear_Click ()
Dim iLoop As Integer
For iLoop = 0 To 2
txtCriteria(iLoop).Text = ""
Next
txtCriteria(0).SetFocus
End Sub
Sub cmdExit_Click ()
Unload Me
End Sub
Sub cmdSearch_Click (Index As Integer)
'
' Setup Form Parameters
'
SetFormParam Mid$(lblTags(Index).Caption, 1, Len(lblTags(Index).Caption) - 1) & "s", PRF_TABLE
SetFormParam CStr(txtCriteria(Index).Text), PRF_CRITERIA
SetFormParam Format$(Index + 1), PRF_INDEX
'
' Pre-set Result as current value for a default
'
SetFormParam CStr(txtCriteria(Index).Text), PRF_RESULT
frmSearch.Show 1
txtCriteria(Index).Text = GetFormParam(PRF_RESULT)
ClearFormParam
txtCriteria(Index).SetFocus
End Sub
Sub Form_Load ()
CenterForm Me
SetupInfoMessage
End Sub
Sub Form_Unload (Cancel As Integer)
End
End Sub
Sub SetupInfoMessage ()
Dim sCaption As String
sCaption = "This demo program shows a method for sending parameters from one Visual Basic"
sCaption = sCaption & " Form to another. Click on one of the 'Search...' buttons to look"
sCaption = sCaption & " for records in the corresponding BIBLIO.MDB database table."
sCaption = sCaption & " Optionally, you may enter valid search criteria in the"
sCaption = sCaption & " corresponding text box."
lblInfo.Caption = sCaption
End Sub